package org.example.system.service;

import org.example.system.entity.Route;
import org.example.system.mapper.RouteMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RouteService {
    @Autowired
    private RouteMapper routeMapper;

    public int add(Route route) { return routeMapper.insert(route); }
    public int delete(Long id) { return routeMapper.deleteById(id); }
    public int update(Route route) { return routeMapper.update(route); }
    public Route findById(Long id) { return routeMapper.selectById(id); }
    public List<Route> findAll() { return routeMapper.selectAll(); }
    public List<Route> findByName(String name) { return routeMapper.selectByName(name); }
} 